import request from '@/utils/request'


 // 分页查询
 export const getOrderList = (params) =>
 request({
   'url': `/order/conditionSearch`,
   'method': 'get',
   'params': params
 })


  // 各个状态的订单数量统计
  export const getStatistics = () =>
  request({
    'url': `/order/statistics`,
    'method': 'get', 
  })

 
 // 订单详情
 export const getOrderDetail = (id) =>
 request({
   'url': `/order/details/${id}`,
   'method': 'get', 
 })

 //接单
 export const takeOrder = (ordersConfirmDTO) =>
 request({
  'url': '/order/confirm',
  'method': 'put',
  data: ordersConfirmDTO
})



 //拒单
 export const rejectionOrder = (ordersConfirmDTO) =>
 request({
  'url': '/order/rejection',
  'method': 'put',
  data: ordersConfirmDTO
})


//派送
export const deliveryOrder = (id) =>
request({
 'url': `/order/delivery/${id}`,
 'method': 'put',
})

//取消
export const cancelOrder = (ordersCancelDTO) =>
request({
 'url': '/order/cancel',
 'method': 'put',
 data: ordersCancelDTO
})



//完成
export const completeOrder = (id) =>
request({
 'url': `/order/complete/${id}`,
 'method': 'put',
})
